// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file was generated by scripts/generate-benchmark.py, do not modify!

const dataBig = [{
  a: '-0xC157BBA2C84DBF6767128DBA5B2E00D00EEE000F2F12477A5FEC2E483874',
  b: '0xF804C167DB',
  r: '-0xBB50953634BEB7A89F670FA3A9BB61785BD655702269842D6058F43A06CB5F05F2F73C',
}, {
  a: '0x2980ED3444712E2581AE2D3F28819C74B535A791A9A107',
  b: '-0x166DF59FF64104105F86909C',
  r: '-0x3A2E819CF25A573D1DD2DD31A89796A4BBC03C050481CEBEBFEA7AF445208109C1044',
}, {
  a: '-0xFF8550F2CEF',
  b: '-0x3482D237A2274ADBFD7CE558A560F1DCAF3DAB7B12103AC8BE3F8004AE4',
  r: '0x3469A7F7513AFD0C6EF740964FBE2367739E1FBCEFB906C6716C633E815236AC811ADC',
}, {
  a: '0x3700B9551AD4F8',
  b: '-0xD2597E5F9A51D1118B4AFEB203605D673DF87EC2C86A6D9C2E0C11EB',
  r: '-0x2D31D26F243DB4E73171EDB0DDE4E086974E0ADB307249BF7EE653673C276E7365F7A8',
}, {
  a: '-0x73A6F49B9772B134FA950D9D6A04868794F71315B76A2F826D2E54',
  b: '-0x225B0FF7496717A6',
  r: '0xF85500C1D005FE8A62E2EC42AB5A349A0AB6DAFD0A2CAE81010D8B1B25AB5F9C19678',
}, {
  a: '-0xB9C75E78540',
  b: '-0x2ED61273252FF818B8BEE0176F3203AB366E94CA4C4ACA3E3E071A5B4F7',
  r: '0x21FD2D062BDEBE428C82A925EDF2DBDFC1B438EE26B7A9F3CB8F8BE194BEE6AE5290C0',
}, {
  a: '0x28CA33C7509BE560B1318D5A5307A6F',
  b: '-0x6A92308EB774DB55469A5E48C8E3611C768EB44',
  r: '-0x10FB047EB625C7244D9D7D36452E85B9081A7330DDC8EB9FD753D272B00DA0675C6A7C',
}, {
  a: '-0x94601F0B364544BEE42A9C2A7B94A8B157C9039B401F',
  b: '-0x1EEC403E56E10205D42DBEB342',
  r: '0x11EC317C18172C4762DC7B9AFBBD2FA61ECF9C1B752155C21954D9BEFCDB8385DE34FE',
}, {
  a: '0xFFC5AA365C1FEF6F8C520CEC3C4E7F14DE0798643ECC74',
  b: '-0x15A22BD923E0F5A1B3F0040C',
  r: '-0x159D3DDB51F21D0B38894882337C18D31926F40364E973F9B72FC10626397E76E36570',
}, {
  a: '-0xAB86E5B1671C1D418252DA6340578B7469B3F49984449D',
  b: '0xAA2002E2756264016C46E880',
  r: '-0x71FD07534E2E4BFC0F9D95E717C6E189BA9D95F01D1DA0862FD890AF0105269F3E9680',
}, {
  a: '-0x722B809C1C498A49977D4E0014E6E25104',
  b: '-0x316E7EB8B42835CC4ED34ECC39D3869725B1',
  r: '0x160B9AD2ED68066A04441E641BAA47959BEE2F98E5898941E92BDD5DE26404398B97C4',
}, {
  a: '0xFEB326EEACFED8CD272D9947CB114FC',
  b: '-0x65C80121F92A824030CFA0A3BF7F4273769A884',
  r: '-0x6543AB7314DD31ECFCF9B4E2329B94A2E110C3398E7527A22E999320D134EC407031F0',
}, {
  a: '-0xF15CB3AB0B7396694B9E4ABCC6E9310A05788',
  b: '0xAC6E523984F06401EE49862FBC2BEA160',
  r: '-0xA2924C120BB7D1509D6E6AF0C4C0352FF9943DAC9BB009A65898F9496BB0491A1D5B00',
}, {
  a: '-0x94EFB899D5A89736B74BD88C4D855EF8E70592A71A0D2C385DF28',
  b: '-0x818BEBB0814D4B912',
  r: '0x4B5E334D7EAEDBB80833BDE39C7E126B6E02C95648A5AE5753FB8B04E72FA96ACD98D0',
}, {
  a: '0x42834E952F0ED903',
  b: '0xDAAEDF704311FE13F7F29AFD08014AFF09538102DF98D0730BE978',
  r: '0x38D14037FFCC00734EEE2412602ABCD6AA0AA1DCBE45AEE280F0E5312669523E9A7468',
}, {
  a: '0xE3B5555EEE3185E6B86A',
  b: '-0x17E9C79394C17A70DFEF78EE06453D21233DE048E1B3DAE149',
  r: '-0x15453C3B759AFCBEEE905E548D3210C5C374F4C2F3FD61FEBCADA1709DB1641F23C03A',
}, {
  a: '-0x4BB491D331AB63C782B0DF70B3F7CF9EC36C1A095244A6',
  b: '-0xA2D240707F5CC284FA35F6E7',
  r: '0x30267175ADCBCF4F057012E19864EA831C000273F5060E6B8AFFAB06CF071DC99175CA',
}, {
  a: '-0xEB268F5EF48C66782561909654AEFCCD',
  b: '0xA8DA5EF4DD3744C30D0C0036153161B9EA6E2D',
  r: '-0x9B19E4257BF0F551ED3DCC66C2638A3E1C373B00234C3567A456B2DA64E6204BC48609',
}, {
  a: '0x8FA64',
  b: '0xD50939CB228E92558694CF005F3ABB333C613D6B194035721B6D7543A78DD507F',
  r: '0x778A80864078D4D44E37C5C4A32FA675B0C04774F5E803CD72AC745631C7C9DB07779C',
}, {
  a: '0xD37E02CC2866CA08CF05ABF7C52A761',
  b: '-0x530E42585EBE7ABA1406FF84B95B8753238156C',
  r: '-0x449DA29BD692C3A91CD08FCB111CB8556754314187DFBF6C1CA8947D8C8C15C9D191EC',
}, {
  a: '0xF9766A645B5C544C',
  b: '-0xE26C6890FD9CEADAAB52EDD4B7C8D5B47D005FBCCBF1A87A23EBCC',
  r: '-0xDCA42DC6DFF59B18E4B9740BB2CF8F1A2A2609262A385937EF43DB658043824D58F090',
}, {
  a: '0x5053E8EF372B36797F58497BCBB1F4D56939B2D9',
  b: '-0xAD9FC66A3879114863DAA115DDD066',
  r: '-0x367AD6C98F7B4768EB1442A88601E9AC08CCC83C383288A5D461621F33C97B00A29276',
}, {
  a: '-0x9151B332',
  b: '0xF1D0F5BBFD4CC7DDEA6B324DB4EB81B9E898AC0C1215797335CFF4C854867C',
  r: '-0x894487919196135417BD17A9AB2BCBAC5A4565B3742DED963B0C1792D608CD03C6F838',
}, {
  a: '0x8F387A5E6A183AC88F79FF87355BA68C7B2CF1A400A1F645A816D',
  b: '-0x8ED9FED561368A925',
  r: '-0x4FEB495182ABC6C5471F160A7C938728D3CE0565538B83941A9AEB4F100FC6EBCDA9C1',
}, {
  a: '-0x59535A556FB6B61387992060EC',
  b: '-0x13D968F95BDB7C693DE038E16A245C8FC49C75B5A27B',
  r: '0x6ED0BFCC8890AB36AA262C50C3D0E8CCF017D939599E6CEBE60EDD776010D72BFE964',
}, {
  a: '0xD4C25A6D4F43788320CAD8AC10CBE1DC614CE86D4FA8C9CE15665A1F5427AF0BFFAE8',
  b: '-0x4',
  r: '-0x3530969B53D0DE20C832B62B0432F87718533A1B53EA327385599687D509EBC2FFEBA0',
}, {
  a: '0xE2128DA62FCA04B557B57EAE21BF',
  b: '-0xAFA0F363A17A628EF9D9DD4BE7D9BAE2A1CFEE656F',
  r: '-0x9B18D15CBAC43D12884D4C0E4D97E56BC8B2D2F96EFEF9BF28DF69B37A0CF87162FCD1',
}, {
  a: '0xC2D709E982FCBE2FBFB01F81778D6A57A059021070D56DF4D4',
  b: '0x6F4EB7EAABC201CF0EF9',
  r: '0x54B726CB984FC781F96808982F6B321A66EF691E0481E0112403BFF19F4FF166C2BA34',
}, {
  a: '-0xBECA6DDB5BA45C5A45',
  b: '0x1B63CA47E28A47E503F26A1F691FEF102E3D96E205799C725FBA',
  r: '-0x1469B89FEC28182309482BFCD1FF5B968E1C3AF9639DDF968D05B8FB83DE52EF533122',
}, {
  a: '-0xAD4B57649D6D9E8277127793073610F913874B3250BD545',
  b: '-0x4684CBF4B3EC0363FF08983',
  r: '0x2FBC7ECEF6D4AC74DEA2990EAFF4CE826B3D77B52337DAF52A0DBA9290F7A135E00F4F',
}, {
  a: '0x5B831FDA54D2BD65890DEDB892A0FA0B9201BD9CE90DCD37F6D',
  b: '0xDD1F798B554EAF39354',
  r: '0x4F0B72D31F695AD3893FA1E2A7D5D63E1752CB4AE108E311B4A74384A5C6557E0866C4',
}, {
  a: '0x241E43F33D4F737E35CDECCDDAA94865',
  b: '0x1C38995254AC9DB83A009CF23897F06C2A929A',
  r: '0x3FB4BAF2C2A8673361EEFC626B6E07098EA1901B219C6EE928E45A972968A91B126C2',
}, {
  a: '0x907C',
  b: '-0x2FA9CB4838FE84CAAFCAAFE66BA7B690FC393539335160AC9D05CD7A8A5D7A63F2',
  r: '-0x1AE69897170AC5FA550F291ED02A7BEDFC1A59A5F492A1CBEBEF5264752F9A1F808938',
}, {
  a: '0x6E5409B4E460A425E959467DDF64C05E97CBA5463C10AD4159EFF1DDB53425EF1319C',
  b: '0x8',
  r: '0x372A04DA72305212F4ACA33EEFB2602F4BE5D2A31E0856A0ACF7F8EEDA9A12F7898CE0',
}, {
  a: '-0x3A0391CF921F934F66E96CE9BFFC21F1594B6C3B885082BD9124A',
  b: '-0xE3D014FD174E2036D',
  r: '0x33A051F3296C1151EAF8591F2498702C9B0AD46AD435EE2F02E1BE215B9353E3F7A782',
}, {
  a: '-0xC281F',
  b: '-0x609E3236A753A163D38565ED3BD30403F8BD856F4D981E3D0C5DB86750F3779BF',
  r: '0x4968EC59076AEE5060E643C3336F7675DC43AFD042FBB9501C7B7C9014492737B19621',
}, {
  a: '-0xC41742',
  b: '-0xD56394C56A5D8C1E28D5F5A8B981E3AB7224D19616E916108C0E363243B14951',
  r: '0xA373A0DD2F87131ACC1941D569859CCE347DA5333C0F35BDBE67BAE10450C6834F2DE2',
}, {
  a: '0x54745',
  b: '-0x39C763CA289DF47104C247A6F8E433F4BF82082A58CFDA234096B0267A3CB11E6',
  r: '-0x130FAD25DC1D687935293907F7B7D63B29F9ED723AE1AD835D55BA43889753D1309CFE',
}, {
  a: '0xC3061D478C7702F7A7345783535CBD9C0EBC0D1C8DEBDA78AE570355C',
  b: '0x37C70299B889D',
  r: '0x2A7DEC06494332C8749FC5C1DE155FBB37AF5E069757E57BBFDF66662D55CE5CDD996C',
}, {
  a: '-0xFBDE1EA1FEA1614E5D199EF35BC7A6B303B9A8146DFA5A402142E0A9D20DFEACA3E6AC',
  b: '0x0',
  r: '0x0',
}, {
  a: '0xC01EB0C17B2EB170A33301D3278EDA2B3926E66E1AE505',
  b: '-0x6C5E7F9413B8BE91B1883271',
  r: '-0x5153DD94E13E0629923D0DB132DA51DCFEB10A9DCF1EC7D32F3774882BB1AEFA421135',
}, {
  a: '-0xE1521905D6BBE3349FB495A9AA50',
  b: '-0x9172AB28D20F7D4A458310626E09186A503761B2EE',
  r: '0x80046D6137A7D551C0A35530C3417C9C63F1F6FEF44E9E019B2793EE968BD3D477F660',
}, {
  a: '0xBA729F94198F02DB',
  b: '-0xA81DBE504DD5772AA5BC5ACEC5A9FCEE806FB517C90B156A08CB4F',
  r: '-0x7A70E250D37E7A7BD538CBA17489B3A2F18A070F8EE1F03AEA365BE5ED57960F3D8A95',
}, {
  a: '-0xD',
  b: '0x22AABF127B89F0F24A0E52B2CCE0616A57A81CAC79C270F751D21BD111F2797A4121F',
  r: '-0x1C2ABB3F046013C4DC2BA33146764F266738974C22EDFBC8F27AB699DE9502B354EB93',
}, {
  a: '-0xBDB72B4E2DAFE800C6BFF7E943456BB24D6A844DF91',
  b: '0xFC2CFE5CEDA5CC1394A20A6F04E',
  r: '-0xBAE1A69D0151956C5A1F108EF851644599EDC83F38E544C225F87939C918ACEE9A0E2E',
}, {
  a: '-0x4AB81',
  b: '0xA2CE4720A1EE1067DEC9661CBA3CA7D4A297A3B29B52AE3D0E6AD8EC3187C6037',
  r: '-0x2F84AEFF72B53DF8B214D63248DD2FBFE251FC78C380B3800CF11066DDA39BEBCD38B7',
}, {
  a: '-0x5DB101ADFD92FEDA5FAD0BF',
  b: '-0xB7B4470FA2454F92858502D14CCC7A4190493593F646441',
  r: '0x433B82AA5ED41AF3B9ED20C6A9D8836B6CB2A8DAD99FCD0598E37D8597CEECA9D59C7F',
}, {
  a: '0x5DDE94B9760D60F393F7BC3CF04801E',
  b: '0x10669554C14BD73681D1B11F88A436476AF656D',
  r: '0x60386BC79BF3B33AFE8DF670F176D283D3DF048FF15B14FFAC3B673986FE553F862C6',
}, {
  a: '0x60574456EFAC69189AB9098C6F72EBB41BB555E4DB',
  b: '0x34E27A3835851388965655702848',
  r: '0x13E6F4EABB3B22A0C0BE7C39E18521296849C5524CACB8DA59232D3A0F0A4342BA9598',
}, {
  a: '-0x9214ADF222F8C63AC96AA13D3BDE8436799817',
  b: '0xE4FFE4E10A6CD3AB6C847CC33B68FE72',
  r: '-0x82AC701FC061D79DD1C3BD5EBB6083110B31F90F0F69E452EC9B7B0DDA69E4FD648C3E',
}, {
  a: '0x8929B9B',
  b: '0x42C5811ABB9A0499353050AA2A21A61116B58D4586B439DCD9073D543E2687F',
  r: '0x23C694279DC28C14013640AC774F2EB2060850D6A52163F94E3C02A6580C9DBFC829E5',
}, {
  a: '-0xADDC2453E1CD2FE06DB7B92C',
  b: '-0x4730C136613E993F3CE1AEA77DCBCE9260D5CCF75F21F9',
  r: '0x30592A91F93812D5A3FE31E760057F181637584B0DE4CA99089E1235DDA55691E5C7CC',
}, {
  a: '0xAEB484EB025F51FB650D0E9886DB68FD534EE22B9B4C2C661',
  b: '-0xAA91FA2117D143D507FEA',
  r: '-0x74677F3638034EA7065C4773E647703D3F601B27C0582C0F153BD26786A122F5C373AA',
}, {
  a: '0x3B9A2AEA74AA2DA40E440876852BB5AC5BCC9A66DF966470333AEF',
  b: '-0x7ED2B0629C9BDFF0',
  r: '-0x1D86EEA78CBB50A7DF1640DCBAF444C6E0447E370C70FC6C10BA009EFC825223127110',
}, {
  a: '0x804B34F01EBCBAD03C8AB99BC5BAC7E8CDCAE30A71E7A3A0AA88521222A6D57B7',
  b: '-0xEA25B',
  r: '-0x7557A175D732092B17DEB75495DB66AA1A313F55D8B7605AC297B5F628B7F91261FC0D',
}, {
  a: '0x1D30942240D65AAE513F3784A142C8D3615443A2B2',
  b: '0xF0A648072944561DC640A3E64CB7',
  r: '0x1B708096A5B141A0D4EC3D2F6B02B8C54DF7148AED3947E662AB39D9511D72D292253E',
}, {
  a: '0x2A67FFB5609512B8684DFB78E0E2382442D083151E222',
  b: '0xBB3D26A25ACAB09A433FB7825',
  r: '0x1F0418F7C093C885FFD1F316513E7603321E7DEC9BCBF2CB26D988EFF0146B002B9EEA',
}, {
  a: '-0x23ED132EBA84E326B7CD0E1D949C6385C35B86B23881BF776844C0C6886C5',
  b: '0x6507F1798',
  r: '-0xE2DA5F031F11F851C7C2F15548CCF7BC0A59C8A60E8F0DE4F3AC2444F5CDB2DE6B7F8',
}, {
  a: '-0xED5FF09EE5153BD27B7A6040A95',
  b: '-0xF55D051E00601C20D0F763E7F74D3BD6F7CD0061E6F',
  r: '0xE38311E12C40F61E95F3CD3D8E3F7338196659A14E57CA269AFDF06869A5F2C47C0C9B',
}, {
  a: '0x82FD0F33AF1B3BB8E6EE4104F29052A23E84758C856CEBC9787D53AE30FEF41FB723',
  b: '0xF6',
  r: '0x7DDF2C9BAA442B63ADE8F27AC116AF67E81348F50836AA9399C86E696314FE9679FBA2',
}, {
  a: '0x8C1F28A22C38454B6F2C2C433AFAD907F1E63',
  b: '0x601682D293DB400990F282BF685E68570',
  r: '0x3498018563A47C59003CA54A1576CE606700C5BE7947168E6CADB7739DB921FE58BA50',
}, {
  a: '0x8AC543D4C528FFFE29E135',
  b: '-0x31DA4F2779BF5F218A4F941699E25568DF145E8C6D02FECC',
  r: '-0x1B0618DFC2E7B5F9E434DB75B0E573488F7BBBF6F44D772448F3759FBF1A5F6A3C0C3C',
}, {
  a: '0x93737065EE7F5BE6',
  b: '-0xBB5E869FC845A14175AEB1A247FB9EB1217AAB382E2E0502F80A0C',
  r: '-0x6BEBC5082F870FD8C73D45FE60A1D7204E047FB391887DFF29FCF678BD69AEFA5F4AC8',
}, {
  a: '0x44C969059E62063B1A8E',
  b: '0xA5BF95550332A9A10B5C6655BD312C5FB316D1493CD0C8042A',
  r: '0x2C894B160C227659326420B9F724EFE972A2D8E1E941615E6E8C55E5651F36110C934C',
}, {
  a: '0x4597793C57FB',
  b: '0x763B3A2DC522E7E0376581E85C8947362CDB89F7581A6A8ECE6D26E91D',
  r: '0x2023EB9B842501D580D581A5C2DAAB0984264F608EAAEC0DCEE20305C375E5962B6A6F',
}, {
  a: '-0xD85AE25665AA1CDD5D91C235F0147E4028F4C6785DA62DCAAFACE6CF5A9AE03945F',
  b: '-0x6B4',
  r: '0x5AA41352B2178497BD73509D18D495E461288C25ED3BDEAF2A192FB25EB5626FFE8CCC',
}, {
  a: '-0xCF8875A51E6E240AF9B34B495EED9D8C3A71362FC',
  b: '0xB2D593D98412D0C5160A9BF61C842',
  r: '-0x90FA063262D60DA3B7933A344B5E855E8229F992A18963B7B05A6993F35A86BDD064F8',
}, {
  a: '-0x4206E9039C36F76C00123899451E59BFE3DA9760617E4BEFFCF6D7919FCCAFD239',
  b: '0x86C2',
  r: '-0x22C1A7347881272A07E1976F1E5443FA74AF16E32A11FD752A46E7E596003D25472532',
}, {
  a: '-0xDDE61EAB1CA49386B96BDC7C9D59572',
  b: '0x3BB8EB8C622929DECFD790923A3890704552232',
  r: '-0x33C452A367AC230C39FCFE6950F230C81FBBE2405CEEFE61F1D43BBA8A0C32306A5444',
}, {
  a: '-0x424CE82F2126ED7BB9D6A954F9A46FD0',
  b: '-0xFBAFD74E967E2D8EF10357057DB9A00CFC16BD',
  r: '0x412EF1FBDF20E55AE09C3DD63C53C65DDA3FAF78E37F08698EBE3CD584F64C40C26C90',
}, {
  a: '-0x79CB73F681AC7BC93D5D306CA8FA0B8',
  b: '-0x7163312D54D05EC6B438298990B040AE9B68518',
  r: '0x35F1FF4329E0BDF0DA70135E462593551A2B114BCCF321B9F42B792FE6327356C6A940',
}, {
  a: '-0x3D33989F5EF9F6B9F16DC737',
  b: '0xFAEE7B078205E3BA8FD2168A53E69F7D115071CBE74D8F',
  r: '-0x3BFD666D1CBDC246EC90C9D6E33FD8E640ED661E19BB53D483E609466EC5CA40DED2B9',
}, {
  a: '-0xDBF938495296AD0',
  b: '-0xFB350C44CC741291D4CF9EDE421FD856BA257CAB3A9528B3856DB27',
  r: '0xD7DAEF5357AC8DE69526451CCADE3A3E05C5EE341543463BB98950BF90AF04898F35B0',
}, {
  a: '0x4A505315DBD88129945CB8D69768D077BEDDA4512FE9B94D0740164752EC4',
  b: '0x95315BD30',
  r: '0x2B4F14636DE157C815AB9A5685539D16A680EC9ACE847F88DF78CC4C88A817BB9378C0',
}, {
  a: '-0x751D7AB8BBFFA44FF2006DC552593930F3F',
  b: '0x2B763524580FE459980DA820EEFB4BF7A88',
  r: '-0x13E20783539180B677061D615737295F7EA14CD8D5560AB0AFD4DACD8C538C27651F78',
}, {
  a: '-0x65BAA60F3237144ACD4E044BC8',
  b: '-0xF3D7A762E7B5154AF81951AFFB8BD42F92498228F322',
  r: '0x60E5DDE5F348515D6C3E5F7CD51BC2C5769F0803F0BF28FA652248C18EDB81D7C0E890',
}, {
  a: '-0x92E3C2955C2C',
  b: '-0xA85DC6966FA93D71E39C09F4D8C79F5EA38C050EED9AA5766056E6DA86',
  r: '0x609B46622EC4C1C5DFD8E5FBAE7A9C15712359A5B31D921FF34369AA3CAE92A233B708',
}, {
  a: '0xE69C3E05D492DA057968A30',
  b: '0xC694749591CB110686B205DDBCED56FA17737F109F71217',
  r: '0xB2E29351E628A39A48793A570164C1725CB6938FD8461CB1379963684993DB788DCA50',
}, {
  a: '0x85F603478141649E6CAE1B2F3028D07F045B03B07FD350',
  b: '0xCDF729AA1282AAED07773745',
  r: '0x6BC756CAD213617458A9560BD54CA9BDBDFA25977CC03652CF6B83CB8E9E2C730A2490',
}, {
  a: '-0x5239945F9A464FD35B',
  b: '0xB139DD04AC9556878D9BB4FF97146CFAC2A3093C0A745A2E4285',
  r: '-0x38EC6565585F77847CFA1660EF1CBC49A80FF99B19617FBC8F0A914BED772914504447',
}, {
  a: '0x600D55192FBBD0F8849A2981645136DB865D70B52F93FFFFB2',
  b: '0xC27518C61E9AEB7E830E',
  r: '0x48F609E0907503813685288450652A052520703AA23E668EB8013F1ECAC622577411BC',
}, {
  a: '0xA4D0EE734284669F0F57A83A42C4C0B73D2BFD27F9CCC425E605A077BE248B',
  b: '-0xE17468B2',
  r: '-0x912693A6D3D5215A564EF767B65FD22ABAE3D1B140186C751066F4622D7A7F3B09E0A6',
}, {
  a: '0x898B3BC523B07FD4BA91792BF07BD6D2EB7D98D98B7A97C0BA',
  b: '0xD16B40F5ED236C26E47D',
  r: '0x70844BE4DE236E33B2BDBFF8603117B34906FFC023B51C53E36307C9FC358D175AC2D2',
}, {
  a: '-0x66A3C551205B570DE23217FE9E1B54',
  b: '0x45F6220BEB5A7A5AF13C1C077086299B7AFB7601',
  r: '-0x1C0CD335014893C84458F995D365270164EE5B25002D7C5D2172B567EA3F5BB292D354',
}, {
  a: '-0x6D607726459E118C84AB0CB1C2E71053B797D19',
  b: '-0xEB31AEE52DFA8D80BFEB50D0A031717',
  r: '0x647CC7906C27078649798E2B76F369BFA13DEEAB089CC33A77E71058221864B3727C3F',
}, {
  a: '0xB4B58C279F8889FC5E68BCEAC0388BE7274B2DC97C',
  b: '-0x4325C4FF5314DC0B86F2B5B45E77',
  r: '-0x2F662CFADB4552696428E2B2AE5E23025D30B6777BB15AC21BFB3838C47BBD197430A4',
}, {
  a: '-0xC88819FFBD1DDE790860AEB2F39C10',
  b: '-0x92A4C3BD5F5DD2EB418317D1B7E582000ECD24B5',
  r: '0x72DEAF5884AD2F2F327EA18463676A6CBC1041163DB02A061190B979C3AC4BA0FF9750',
}, {
  a: '0x6CBF3217829AD2C0DA6C7640B20D354C5291C418B24',
  b: '-0x2CE52248B91421C1B4F40EA28C6',
  r: '-0x1312323422865F26CD46E839C51641298020FEA058F5473C6C9F4852D9DD0447573DD8',
}, {
  a: '0x9836F02AB804C0FE7854294E46240CF5531A08FF7F8B2',
  b: '0xF0E837779E1F25B5E5FA4A980',
  r: '0x8F3D93ECA06277EF92237E770F65081B5FC5A6C6D19ABCF7A5F986D55DA6D40F31DB00',
}, {
  a: '-0x220BAC5F3BAC98CB3A092E90CB964',
  b: '-0xAD5B11A265D1DF9835C9A83FBB9A0EA4D537E5243',
  r: '0x170DFFFB008DC51B955B5F22A1694285F857F54A6A8418A9F94F78E319148BBCEE8D2C',
}, {
  a: '-0x6079CB48A79EDD20623A34F0AF371E1B5E202EBCEAB4C5E01ED1E665007643D08F820',
  b: '0xA',
  r: '-0x3C4C1F0D68C34A343D6461166D8272D11AD41D3612B0FBAC13432FFF2049EA6259B140',
}, {
  a: '0xAE8D6E5E61E95312D3A16769850E09275F8740',
  b: '-0x79F30488A4D60BB1BDCEE3697B9B5A11',
  r: '-0x53268C81C11EE15168B8C4790A01F5C1CABF74CAFFE1C0C3EC3CE89ED71C85D6A47B40',
}, {
  a: '0x5B7A48DB0E742A1AE12469C92811564398833',
  b: '-0x8CF82D8671E277AD9206FA391DB9A77FF',
  r: '-0x325F8E92E9A012A459D21D7E00FEBC11BD1580A132785D12B9AECED7F6A5E8234C5FCD',
}, {
  a: '-0x222A647744562F53C2789BF2BED9AB1C58E80CD0B2F1376DA063DB896AE4077E95',
  b: '-0xF586',
  r: '0x20C47456BAD44067EEF53860F1B636B1B1EC9DBA707E844EEDE1855F6D3A2E8810DAFE',
}, {
  a: '-0xD4555BF11911750466C0D9',
  b: '0x941EF9CD477ADBEC3F0591F27E27BE2ED8CFEFEC277722CD',
  r: '-0x7ADB0A5972D0BCBBF72EF158EC92194BF30BFC4E63CDA94D3AC2BC5AB0977ADFC43FC5',
}, {
  a: '0x4BC3ED963E86D4DB6056EC8352',
  b: '-0x66F9790851A10188A119702766A682308A9C30F829DE',
  r: '-0x1E79E60E05A09F0D498D38208EFC6BCD6E0F2A0288201BAC4CACEC53A3732DD992031C',
}, {
  a: '-0xB00B59101E1595221D932194D1215511C4898BC9FA',
  b: '0x5E53BD634EC8415834DDDDC0E4E3',
  r: '-0x40DDC09E7697302379FF22EBEC8008C5E32EBA064D60AA50E6A7855B0AC6CCC456C0AE',
}, {
  a: '-0x3665E520DDDF9FB1CB59EBB42',
  b: '0x716C9C646E60B02780766FBC246AF8818A8A86F154AD1',
  r: '-0x181A0E5B9AAF2BF848711CA434C8733B39B2C8265209C445DAA36181053B772321F4E2',
}, {
  a: '-0x794E73',
  b: '-0xCF2B712095BC5B57A3D2ABEDB6DFEDD53964DF8EFEA063C9983EA640EA195DE7',
  r: '0x622B04C5628549D3DE2ADC0B611958CAD6EEF32F0458A06ABD358F0F7B1C7A463090C5',
}, {
  a: '-0x5E2F08E721A591281560CC022DE341C101457EFC6',
  b: '-0x5CD99215F714A3131BC2527737119',
  r: '0x2228F2D083D98AEB4FEB5455A6C69A9C56667122B153AEAF6A3565117D6F32AD5ED056',
}];

const dataSmall = [{
  a: '0xF',
  b: '0x2E3000FC40B62AA',
  r: '0x2B4D00EC7CAAC7F6',
}, {
  a: '-0xA28B15FD64E65174',
  b: '0x0',
  r: '0x0',
}, {
  a: '-0xACA820',
  b: '-0x633754576C',
  r: '0x42EA55610079CD80',
}, {
  a: '-0xFBD9F',
  b: '0xE9D1FA907CC',
  r: '-0xE607EEDDE9B173B4',
}, {
  a: '0x8C0402CD16FB5A',
  b: '-0x51',
  r: '-0x2C4D44E2E445877A',
}, {
  a: '-0xDE078F9CB0',
  b: '0xEA66DD',
  r: '-0xCB4C1FF4F84863F0',
}, {
  a: '0x754636E8F685',
  b: '-0x21C0',
  r: '-0xF7601BD368008C0',
}, {
  a: '0xA9F255E4960576',
  b: '-0x70',
  r: '-0x4A5A059401A263A0',
}, {
  a: '-0x731B',
  b: '-0x816527D2B98F',
  r: '0x3A2E168EDC94CF15',
}, {
  a: '-0x7717',
  b: '0xA4A5DCA676E6',
  r: '-0x4C97E478343998AA',
}, {
  a: '-0xCECA22AA04C558',
  b: '0x3F',
  r: '-0x32E3BE87D72C90A8',
}, {
  a: '-0x4DAACC1747E27',
  b: '-0xA09',
  r: '0x30B66FA15A05F55F',
}, {
  a: '0x5A',
  b: '-0xBE664A892EDE4A',
  r: '-0x42EFF6343A7A2604',
}, {
  a: '-0xB553666E30C',
  b: '-0x7161E',
  r: '0x504F23796CE5A368',
}, {
  a: '-0xE9',
  b: '0xAE24EEB56CAD23',
  r: '-0x9E7F9D431FE994DB',
}, {
  a: '0x5DDE9CF207F1F',
  b: '-0xE36',
  r: '-0x535F98A577CE828A',
}, {
  a: '-0x6A76B46',
  b: '-0xAA4629EFB',
  r: '0x46D001ADC32761A2',
}, {
  a: '-0x35429',
  b: '0xA9F8388BA4F',
  r: '-0x235C954F1CF4C2A7',
}, {
  a: '-0x5DEF6021036F12D',
  b: '0xB',
  r: '-0x40949216B25C5CEF',
}, {
  a: '0xA61FC22ED32',
  b: '0x3D22F',
  r: '0x27AC3D3AB892902E',
}, {
  a: '0x16DA0C0',
  b: '-0x704EE4D47',
  r: '-0xA06701CD1415540',
}, {
  a: '-0x16F4512B0A5AF76C',
  b: '0x0',
  r: '0x0',
}, {
  a: '-0x159C8CE4',
  b: '0xD09EBFCA',
  r: '-0x119C99490F5D47E8',
}, {
  a: '0x10D6A08',
  b: '0xA6F7F35F5',
  r: '0xAFB7B29DAC221A8',
}, {
  a: '-0xEFD5F49C003',
  b: '0xF55DE',
  r: '-0xE5DFB5AE5EE2819A',
}, {
  a: '-0x8146BAA0A33E6195',
  b: '0x0',
  r: '0x0',
}, {
  a: '-0x429FD',
  b: '-0xC22E5AECAF1',
  r: '0x32892C012803292D',
}, {
  a: '0x2417130FF3FB85',
  b: '0x92',
  r: '0x149528DF192571DA',
}, {
  a: '0x709A54D',
  b: '0x59CF17F39',
  r: '0x2780BECFE3A40125',
}, {
  a: '-0xBD38B898B',
  b: '-0x6C7649E',
  r: '0x502B5CA03EE62FCA',
}, {
  a: '0x7',
  b: '-0xBB9E4A03D801EC5',
  r: '-0x52154061AE80D763',
}, {
  a: '0xF607E1',
  b: '-0x3C28B11F95',
  r: '-0x39D0F430F4B7D4F5',
}, {
  a: '-0xDCBB7EB5C4D8954',
  b: '0xF',
  r: '-0xCEEFC6CA688B0BEC',
}, {
  a: '-0xDB8',
  b: '0x1AB87CE582D8E',
  r: '-0x16E92F16C9B0F410',
}, {
  a: '-0x5D',
  b: '0x52EFA55792D5DE',
  r: '-0x1E210F10D057B1A6',
}, {
  a: '0xFD81DCA',
  b: '-0xBEA151D09',
  r: '-0xBCC6216F1F8AEE1A',
}, {
  a: '-0x6E2CAA54',
  b: '-0x24E79352',
  r: '0xFE1F1A871E8CAE8',
}, {
  a: '0x6D04D7B40',
  b: '-0xB86B002',
  r: '-0x4E890C1D28D6F680',
}, {
  a: '-0x39E175C7F955',
  b: '0xBCED',
  r: '-0x2AB72838E53C3FB1',
}, {
  a: '-0x17038D17A19E',
  b: '0x2095',
  r: '-0x2EDD6B412F4D0F6',
}, {
  a: '0x8A68FA3E11A',
  b: '-0xD2740',
  r: '-0x71C8D4D84E953C80',
}, {
  a: '0x5199E13914',
  b: '0x2FD46D',
  r: '0xF3EF68682D5DD84',
}, {
  a: '-0xDCC',
  b: '0x6A6188A92E7CF',
  r: '-0x5BBB9A97E2D63BF4',
}, {
  a: '0x82C7206',
  b: '-0xBCC4B5CD1',
  r: '-0x606EB91AD5053EE6',
}, {
  a: '0xF55B2C426564CE98',
  b: '0x0',
  r: '0x0',
}, {
  a: '0xFD00619DE',
  b: '0x88B400C',
  r: '0x871A18DE424AB668',
}, {
  a: '-0x9AEF0',
  b: '-0x8E4A02D9944',
  r: '0x561D5CCF8C4FE7C0',
}, {
  a: '0x59359F1FE380B1',
  b: '0x4D',
  r: '0x1AD520DC976DB53D',
}, {
  a: '-0x844CD25EB5B671D',
  b: '0x7',
  r: '-0x39E19C096F7FD1CB',
}, {
  a: '0xADFE1CD386198',
  b: '0x91E',
  r: '0x63252CAD0809C7D0',
}, {
  a: '-0xEDC7FF00068956',
  b: '-0xE5',
  r: '0xD4B3E71B05D8D9EE',
}, {
  a: '0x7E388F96C03',
  b: '0x4796F',
  r: '0x234C1B4BF83F404D',
}, {
  a: '-0xD0ACC48B124',
  b: '-0x2BCC1',
  r: '0x23B35BBAC72BFC24',
}, {
  a: '0x2340B',
  b: '0xC0A3754CF85',
  r: '0x1A87065739D5EEB7',
}, {
  a: '-0x44A3BF28',
  b: '0xA7C744D0',
  r: '-0x2CFC3F6FF3E9F080',
}, {
  a: '-0x7',
  b: '-0x80FC36AD8EB2F18',
  r: '0x386E57EBEE6E49A8',
}, {
  a: '0x550',
  b: '0x8143FA5483682',
  r: '0x2AEB921E0FA192A0',
}, {
  a: '0x3F6EC9B23EE067',
  b: '0xA1',
  r: '0x27E4ACD9198B20C7',
}, {
  a: '-0x3E6ADFE2C6906E',
  b: '0x80',
  r: '-0x1F356FF163483700',
}, {
  a: '-0x4788',
  b: '-0x606802A486CF',
  r: '0x1AF00FFD08CB06F8',
}, {
  a: '0xEFD2',
  b: '-0x67C74BA874F7',
  r: '-0x6138311E55628B9E',
}, {
  a: '-0x92A7',
  b: '0xBE2DF5ED1561',
  r: '-0x6CF2463CA3DA4447',
}, {
  a: '0x18DA8BE805D1C',
  b: '0xF67',
  r: '0x17ECE20E2B1A1A44',
}, {
  a: '-0xA9B7931053A8',
  b: '-0xD769',
  r: '0x8ECEC8CE07F467E8',
}, {
  a: '-0xFE91470958929F5',
  b: '-0x2',
  r: '0x1FD228E12B1253EA',
}, {
  a: '0x8F',
  b: '0x1771090B274D46',
  r: '0xD18240D3AF42A1A',
}, {
  a: '-0xE9',
  b: '0x8C49809732921B',
  r: '-0x7FAEE6099D06FA93',
}, {
  a: '0x6EFA5',
  b: '0xA6B00B01E92',
  r: '0x4842A0BC957A021A',
}, {
  a: '0x5E6BD02',
  b: '-0x512798420',
  r: '-0x1DEEB76F303EA840',
}, {
  a: '0x72DC9',
  b: '0x9B63617CBB6',
  r: '0x45B822393977EFE6',
}, {
  a: '-0xF45BE564',
  b: '0xFC8B9E3C',
  r: '-0xF10FBABDFA697B70',
}, {
  a: '0xB',
  b: '-0xD8BF1F8B5BC0BCE',
  r: '-0x950365AFCF1481DA',
}, {
  a: '0x1BA1',
  b: '-0x115441AC220B',
  r: '-0x1DEC8EA74D891EB',
}, {
  a: '0xC3',
  b: '-0x6A959F0E6C82FD',
  r: '-0x512FF827FCA7C6B7',
}, {
  a: '-0xD4',
  b: '0xB19D204937CDB1',
  r: '-0x93161EBCA2365694',
}, {
  a: '0x813D',
  b: '0xC2363DAF7022',
  r: '0x620B9C021A4EDA1A',
}, {
  a: '-0xAEF5664',
  b: '-0x980D904A5',
  r: '0x67EAF9C904603E74',
}, {
  a: '-0x5F10C293D090CEF',
  b: '0x9',
  r: '-0x35796D7325517467',
}, {
  a: '0x172A7EBFA4F',
  b: '0x40E9C',
  r: '0x5DFC6BD24B8DA24',
}, {
  a: '0x33F7FE8082',
  b: '0xA9546F',
  r: '0x225FDAEADF56605E',
}, {
  a: '0x9CA340ECF296F730',
  b: '0x0',
  r: '0x0',
}, {
  a: '0xF',
  b: '-0x48659CFE3505111',
  r: '-0x43DF432E51B4BFFF',
}, {
  a: '0x5373DC0A867482D7',
  b: '0x0',
  r: '0x0',
}, {
  a: '0xFFC7FD329B8',
  b: '-0x8E286',
  r: '-0x8E09459CA11C4650',
}, {
  a: '-0xE967F0B97E',
  b: '-0x4BEC89',
  r: '0x45391C40E2BD6C6E',
}, {
  a: '-0x1',
  b: '0x8C3CD06C1621E2D',
  r: '-0x8C3CD06C1621E2D',
}, {
  a: '-0xC2BCF8987509FF',
  b: '-0x67',
  r: '0x4E5A080557170599',
}, {
  a: '0x211A98573D5E',
  b: '-0xAE72',
  r: '-0x168ED163228F37DC',
}, {
  a: '0xFE05DEE835E7E88',
  b: '-0xD',
  r: '-0xCE64C51CABCC6CE8',
}, {
  a: '0xEA5D1245EC6CA',
  b: '-0x8AB',
  r: '-0x7EF74BD6418518EE',
}, {
  a: '-0x39CDDC9F8345',
  b: '0x44A6',
  r: '-0xF802A176E4D72BE',
}, {
  a: '0x6E5B10FF035C6EFC',
  b: '0x0',
  r: '0x0',
}, {
  a: '-0xB8B8B',
  b: '0xA1D3001B6F5',
  r: '-0x74C466FCDBCC5E07',
}, {
  a: '0xA6C7D0344C8718B5',
  b: '0x0',
  r: '0x0',
}, {
  a: '-0xC3836',
  b: '0x8AB530EE209',
  r: '-0x69EF33015F01A5E6',
}, {
  a: '0x5',
  b: '0x30463DAD773BFBB',
  r: '0xF15F3463542BEA7',
}, {
  a: '-0xAFE094CFEBB78FD6',
  b: '0x0',
  r: '0x0',
}, {
  a: '0x47BEE9AEAF',
  b: '-0xE061ED',
  r: '-0x3EE27E3B22A70703',
}, {
  a: '0x814CBDFD26E7',
  b: '-0x63C4',
  r: '-0x3263AC3A5BDD1DDC',
}, {
  a: '0x28D526107',
  b: '0xD9041AF',
  r: '0x229D54E474E31AC9',
}];

import JSBI from '../dist/jsbi.mjs';
const JSBigInt = JSBI.BigInt;

let errorCount = 0;

const dataBigNative = [];
const dataBigJsbi = [];
const dataSmallNative = [];
const dataSmallJsbi = [];

function hexParseN(s) {
  if (s.charCodeAt(0) === 0x2D) return -BigInt(s.slice(1));
  return BigInt(s);
}
function parseNative(d) {
  if (d.b) {
    return {a: hexParseN(d.a), b: hexParseN(d.b), r: hexParseN(d.r)};
  }
  return {a: hexParseN(d.a), r: hexParseN(d.r)};
}
function hexParse(s) {
  if (s.charCodeAt(0) === 0x2D) {
    const result = JSBigInt(s.slice(1));
    result.sign = true;
    return result;
  }
  return JSBigInt(s);
}
function parseJSBI(d) {
  if (d.b) {
    return {a: hexParse(d.a), b: hexParse(d.b), r: hexParse(d.r)};
  }
  return {a: hexParse(d.a), r: hexParse(d.r)};
}
function prepareData(src, dstNative, dstJsbi) {
  for (let i = 0; i < src.length; i++) {
    const d = src[i];
    dstNative.push(parseNative(d));
    dstJsbi.push(parseJSBI(d));
  }
}
prepareData(dataBig, dataBigNative, dataBigJsbi);
prepareData(dataSmall, dataSmallNative, dataSmallJsbi);


function testNative(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = d.a * d.b;
    if (d.r !== r) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: *');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = d.a * d.b;
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (d.r !== r) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


function testJsbi(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = JSBI.multiply(d.a, d.b);
    if (!JSBI.equal(r, d.r)) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: multiply');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = JSBI.multiply(d.a, d.b);
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (!JSBI.equal(r, d.r)) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


const kRepsBig = 40000;
const kRepsSmall = 120000;

console.log('Testing multiply:');
console.log('Native/big:   ' + testNative(dataBigNative, kRepsBig));
console.log('JSBI/big:     ' + testJsbi(dataBigJsbi, kRepsBig));
console.log('Native/small: ' + testNative(dataSmallNative, kRepsSmall));
console.log('JSBI/small:   ' + testJsbi(dataSmallJsbi, kRepsSmall));

if (errorCount !== 0) {
  console.error('Finished with ' + errorCount + ' errors.');
  // Support both d8 (`quit`) and Node.js (`process.exit`).
  (typeof quit !== 'undefined' ? quit : process.exit)(1);
}
